<template>
  <div class="monitor-head" v-show="!jtoken">
    <div class="head-left"></div>
    <div class="head-title">桥梁主动防撞监管平台</div>
    <div class="head-right">
      <div class="b-icon" @click="enterFullscreen">
        <ExpandOutlined :style="{ cursor: 'pointer', fontSize: '20px' }" />
      </div>
      <div class="b-icon">
        <Menu @menuSelect="menuSelect" />
      </div>
    </div>
  </div>
</template>
<script setup>
  import * as methodsJS from '/@/utils/methods';
  import Menu from './menu.vue';
  import { localClear, localRead } from '/@/utils/local-util.js';
  import LocalStorageKeyConst from '/@/constants/local-storage-key-const.js';
  const jtoken = localRead(LocalStorageKeyConst.j_TOKEN);
  const emit = defineEmits(['menuSelect']);

  function enterFullscreen() {
    if (document.fullscreenElement) {
      methodsJS.exitFullscreen();
    } else {
      methodsJS.enterFullscreen();
    }
  }
  function menuSelect(val) {
    emit('menuSelect', val);
  }
</script>

<style lang="less" scoped>
  @import './index.less';
</style>
